
import { request } from '@/utils/request';


import { BaseModel } from '@/api/common/baseModel'

/**
 * 产品分类
 */
export interface Model extends BaseModel {
  /**
   * 父分类编号
   */
  parentId?: string
  /**
   * 分类图片
   */
  img: string
  /**
   * 分类描述
   */
  description?: string
}

// 获得商品列表
export const getPage = (params: any) => {
  return request.get({
    url: '/staff/web/userCenter/trade/goods/goodsCategory/page.json',
    params
  })
}

// 更新商品分类
export const update = (data: any,) => {
  return request.put({
    url: '/staff/web/userCenter/trade/goods/goodsCategory/update.json',
    data
  })
}

// 删除商品分类
export const del = (id: string) => {
  return request.delete({ url: `/staff/web/userCenter/trade/goods/goodsCategory/del.json?id=${id}` })
}

// 获得商品分类
export const getById = (id: string) => {
  return request.get({ url: `/staff/web/userCenter/trade/goods/goodsCategory/getById.json?id=${id}` })
}

// 获得商品分类列表
export const getList = (params: any | null) => {
  return request.get({
    url: '/staff/web/userCenter/trade/goods/goodsCategory/page.json?pageSize=0',
    params
  })
}

// 删除商品分类
export const imgDel = (id: string) => {
  return request.delete({ url: `/staff/web/userCenter/trade/goods/goodsCategory/imgDel.json?id=${id}` })
}
